Fix NMEA parsing creating Null Island waypoints (#607)
authorViet-Tam Luu <viettaml@google.com>
Sat, 1 Aug 2020 19:57:22 +0000 (12:57 -0700)
committerGitHub <noreply@github.com>
Sat, 1 Aug 2020 19:57:22 +0000 (13:57 -0600)
commit0e50828b2e59b14a2356a851fc9e96a0940b79f7
treeb6cba67458c1429324069cc733a039c5d1f1c972
parentb79972f1b707bc4f494853af1044bd23567c940f
Fix NMEA parsing creating Null Island waypoints (#607)

* Fix NMEA parsing creating Null Island waypoints

Fix parsing of NMEA GPGGA sentences: ones with 0 "fix quality" (i.e. "invalid") are allowed in serial (i.e. live GPS) mode because (according to the comment) some GPS devices will report previously-read data in the absence of a current good fix. Adjust this allowance to require an actual coordinate value; at least one popular USB GPS device will issue GPGGA such as "$GPGGA,010222.00,,,,,0,00,99.99,,,,,,*65" if it loses a good fix, and the empty lat/lng coordinates (",,,,,") are parsed as 0N 0W (a.k.a. "Null Island"). QString::toDouble() won't report a problem with an empty input so we simply check for 0 lat/lng.

* Use "ok" QString::toDouble() argument instead

... of checking for checking for both lat & lng exactly zero, as `ok` does indeed get set to `false` on empty inputs, in recent Qt versions.

* Revert "Use "ok" QString::toDouble() argument instead"

This reverts commit d226d01c862606615aa599f5d3b649cea12f0700.
nmea.cc